package org.jground.rx.def.apps.cip;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.accounting.*;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class Requirement extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.cip.Requirement";

    private static final String project ="project";
    private static final String requirementStatus ="requirementStatus";
    private static final String topic ="topic";
    private static final String description ="description";
    private static final String documents ="documents";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String project ="project";
        public static final String requirementStatus ="requirementStatus";
        public static final String topic ="topic";
        public static final String description ="description";
        public static final String documents ="documents";
        public static final String $CREATOR ="$CREATOR";
    }

    public static Requirement createNew() { return new Requirement(RXObjectService.getInstance().create(moid)); }

    public static Requirement getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new Requirement(mod);
    }

    public static Requirement[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        Requirement[] res = new Requirement[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new Requirement(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static Requirement[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static Requirement[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        Requirement[] res = new Requirement[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new Requirement(mod);
            i++;
        }
        return res;
    }

    public static Requirement wrap(IRXObjectSynopsis mod) { 
        return new Requirement(mod);
    }

    private Requirement(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getProjectLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, project).getLabel();
    }

    public static String getProjectDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, project).getDescription();
    }

    public void setProject(String codeValue) {
        rxObject.set(project, _to_String(codeValue));
    }

    public String getProject() {
        return _to_String(rxObject.getCurrentValue(project));
    }

    public static String getRequirementStatusLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, requirementStatus).getLabel();
    }

    public static String getRequirementStatusDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, requirementStatus).getDescription();
    }

    public void setRequirementStatus(String codeValue) {
        rxObject.set(requirementStatus, _to_String(codeValue));
    }

    public String getRequirementStatus() {
        return _to_String(rxObject.getCurrentValue(requirementStatus));
    }

    public static String getTopicLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, topic).getLabel();
    }

    public static String getTopicDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, topic).getDescription();
    }

    public void setTopic(String string) {
        rxObject.set(topic, _to_String(string));
    }

    public String getTopic() {
        return _to_String(rxObject.getCurrentValue(topic));
    }

    public static String getDescriptionLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getLabel();
    }

    public static String getDescriptionDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getDescription();
    }

    public void setDescription(String text) {
        rxObject.set(description, _to_String(text));
    }

    public String getDescription() {
        return _to_String(rxObject.getCurrentValue(description));
    }

    public static String getDocumentsLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, documents).getLabel();
    }

    public static String getDocumentsDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, documents).getDescription();
    }

    public int getDocumentsSize() {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.getComponents(AttName.documents)).length;
    }

    public org.jground.rx.def.apps.commons.Document[] getDocuments() {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.getComponents(AttName.documents));
    }

    public org.jground.rx.def.apps.commons.Document getDocuments(int index) {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.getComponents(AttName.documents))[index];
    }

    public org.jground.rx.def.apps.commons.Document createDocuments() {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.newComponent(documents));
    }

    public void setDocuments(org.jground.rx.def.apps.commons.Document[] values) {
        rxObject.set(documents, _to_String(documents));
    }

    public void addDocuments(org.jground.rx.def.apps.commons.Document value) {
        rxObject.add(documents, value.getOidString());
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
